{{define "cp_selectserver"}}

{{template "cp_head" .}}
<header class="page-header"><h2>News and Updates</h2></header>
<div class="row">
    <div class="col-lg-7">

        {{if .JoinedGuild}}
        <section class="card card-featured card-featured-success mb-4">
            <header class="card-header">
                <h2 class="card-title">Bot added to <b>{{.JoinedGuild.Name}}!</b></h2>
            </header>
            <div class="card-body">
                <p>You manage this bot through a web control panel, if you need any help you can join the support server (There is a link above)</p>
                <p>The documentation for the bot can be found at <a class="link" href="https://help.yagpdb.xyz/">help.yagpdb.xyz</a>. Join the support server if you have any questions, although please do try a little on your own first, as the support team's time is limited.</p>
                {{if .User}}
                <a class="btn btn-primary" href="/manage/{{.JoinedGuild.ID}}/home">Click here to start managing it</a><br/>
                {{else}}
                <a class="btn btn-primary" href="/login?goto={{urlquery "/manage/" .JoinedGuild.ID "/home" }}">Click here to login and start managing it</a>
                {{end}}
                <br/>
                <p>For future reference, you can log in and access your server in the top right menu. If the server did not show up as added in the menu above now, try reloading the page, and if it still does not show up as added then join the support server. (Link above)</p>
            </div>
        </section>
        {{end}}

        {{if .Posts}}
        {{range .Posts}}
        <secton class="card">
            <header class="card-header">
                <h2 class="card-title float-left"><img class="avatar mr-2" src="{{.Message.Author.AvatarURL "256"}}"></img>{{.AuthorName}}</h2>
                <span class="float-right">{{humanizeTimeSinceDays .ParsedTimestamp}} ago ({{.ParsedTimestamp.Format "02 Jan 06 15:04"}})</span>
            </header>
            <div class="card-body">
                {{.RenderedBody}}
                {{range .RenderedEmbeds}}
                <div class="col-auto" style="border-left: 5px solid {{if ne .ColorHex ""}}{{.ColorHex}}{{else}}black{{end}};">
                    {{.Content}}
                    {{if ne .ImageURL ""}}<img src="{{.ImageURL}}">{{end}}
                </div>
                {{end}}
            </div>
        </secton>
        {{end}}

        <p>
        {{if .CurrentPostsOffset}}
        <a class="btn btn-default" href="/manage?offset={{.PreviousPostsOffset}}">Newer Posts</a>
        {{end}}
        {{if .NextPostsOffset}}
        <a class="btn btn-default" href="/manage?offset={{.NextPostsOffset}}">Older Posts</a>
        {{end}}
        {{end}}
        </p>
    </div>
    <!-- /.col-lg-6 -->
    <div class="col-lg-5">
        <section class="card">
            <header class="card-header">
                <h2 class="card-title">Information</h2>
            </header>
            <div class="card-body">
                <p>To add this bot to your server, click login in the upper right corner, then afterwards select it in the "select server" dropdown up top.</p>
                <p>Make sure you have manage server permissions and that you are logged into the right account.</p>
                <p>Afterwards, explore a little to get familiar with the interface and the features it provides.</p>
                <p>If you stumble into any issues and need help, join the <a href="https://discord.gg/4udtcA5">support server</a>.</p>
            </div>
        </section>
        {{if .patreonActive}}
        <section class="card">
            <header class="card-header">
                <h2 class="card-title">Thanks to our patrons!</h2>
            </header>
            <div class="card-body">
                {{range .activePatrons}}{{if ge .AmountCents 1000}}
                <img class="avatar" src="{{.Avatar}}" data-toggle="tooltip" data-placement="top" title="" data-original-title="{{.Name}}"></img>
                {{end}}{{end}}
                <br>
                <p>Only showing patrons with subscription above $10</p>
                <p>Patreon subscription will grant you premium slots you can assign to servers, see <a href="/premium-perks">the premium page</a> for more info.</p>
            </div>
        </section>
        {{end}}
        <section class="card">
            <header class="card-header">
                <h2 class="card-title">Check out...</h2>
            </header>
            <div class="card-body">
                <p>YAGPDB is open source! The project is hosted on GitHub here: <a href="https://github.com/botlabs-gg/yagpdb">botlabs-gg/yagpdb</a>.</p>
                <p>Looking for the YAGPDB <a href="https://discord.gg/4udtcA5">Discord server</a>?</p>
            </div>
        </section>
    </div>
</div>
<!-- /.row -->

{{template "cp_footer" .}}

{{end}}